/**
 * 顶部导航栏
 */
'use strict'
import {Flex, SearchBar} from "antd-mobile";
import {connect} from 'dva';
import React, {Component} from 'react';
import CityPicker from "./CityPicker";

class NavTop extends Component {
  state = {
    value: null,
  };
  onChange = (value) => {
    this.setState({
      value,
    });
  }

  render() {
    return (
      <Flex style={{height:'3em'}}>
        <CityPicker/>
        <div style={{flexGrow: 1}}>
          <SearchBar placeholder="请输入老师/科目/特点" maxLength={16} onSubmit={this.onSearch}/>
        </div>
      </Flex>
    );
  }

  onSearch = (val) => {
    this.props.dispatch({type: 'home/search', val});
  }
}

NavTop.propTypes = {};

export default connect()(NavTop);
